//
//  WZQuestionFrame.m
//  ETong
//
//  Created by wanzhao on 15/11/1.
//  Copyright (c) 2015年 wanzhao. All rights reserved.
//

#import "WZQuestionFrame.h"

@implementation WZQuestionFrame

- (void)setQuestion:(WZQuestion *)question
{
    _question = question;
    CGSize quesSize = [question.question sizeWithFont:Font18 maxSize:CGSizeMake(HARDWARE_SCREEN_WIDTH - OppositeWidthRate(20) - question.accessoryImage.size.width - OppositeWidthRate(10), MAXFLOAT)];
    _questionFrame = CGRectMake(OppositeWidthRate(10), 0, quesSize.width, quesSize.height + OppositeHeightRate(40));
   
    _line1Frame = CGRectMake(OppositeWidthRate(10), CGRectGetMaxY(_questionFrame), HARDWARE_SCREEN_WIDTH - OppositeWidthRate(10), OppositeHeightRate(1) / 2.0);
    
    if (CGRectGetMaxY(_line1Frame) > 60.0f) {
        _cellHeight = CGRectGetMaxY(_line1Frame);
    } else {
        _cellHeight = 60.0f;
    }
    
    _accesoryFrame = CGRectMake(HARDWARE_SCREEN_WIDTH - OppositeWidthRate(10) - question.accessoryImage.size.width, 0, question.accessoryImage.size.width, _cellHeight);
}

@end
